class AddPolymorphic < ActiveRecord::Migration
  def self.up
    create_table :topic_categories, :force => true do |t|
      t.string :name
      t.text :description
      t.integer :price
      t.integer :quantity

      t.integer :category_id
      t.string :category_type

      t.timestamps
    end


    create_table :book, :force => true do |t|
      t.string :title
      t.string :author
      t.integer :year
    end

    create_table :car, :force => true do |t|
      t.string :make
      t.string :model
      t.integer :year
      t.integer :kilometer
    end
  end

  def self.down
     drop_table :topic_categories
     drop_table :book
     drop_table :car
  end
end
